/**
 * 路由表
 */
define('appRoutes', ['resolveComponent'], function (resolveComponent) {
    var routerTable = [
        {
            name: 'login',
            path: '/login',
            component: () => resolveComponent('view/login/login'),
            meta: {
                hideInMenu: true
            }
        },
        {
            name: 'main',
            path: '/',
            redirect: '/home/index',
            meta: {
                hideInMenu: true
            }
        },
        {
            name: 'home',
            path: '/home',
            redirect: '/home/index',
            meta: {
                title: '首页',
                icon: 'md-construct',
                hideInMenu: true
            },
            component: () => resolveComponent('view/main'),
            children: [{
                path: 'index',
                name: '/home/index',
                meta: {
                    title: '首页',
                    icon: 'md-construct',
                    homepage: true,
                    hideInMenu: true
                },
                component: () => resolveComponent('view/index')
            }]
        }, {
            name: '/sys',
            path: '/sys',
            meta: {
                title: '系统设置',
                icon: 'md-apps'
            },
            component: () => resolveComponent('view/main'),
            children: [{
                path: 'user',
                name: '/sys/user',
                meta: {
                    title: '用户管理',
                    icon: 'md-people',
                    storeModules: ['UserStore','UserRoleStore']
                },
                component: () => resolveComponent('view/sys/user')
            },{
                path: 'role',
                name: '/sys/role',
                meta: {
                    title: '角色管理',
                    icon: 'md-contacts',
                    storeModules: ['UserRoleStore','ClientStore','ResourceStore']
                },
                component: () => resolveComponent('view/sys/role')
            },{
                path: 'client',
                name: '/sys/client',
                meta: {
                    title: '应用管理',
                    icon: 'md-apps',
                    storeModules: ['ClientStore']
                },
                component: () => resolveComponent('view/sys/client')
            },{
                path: 'resource',
                name: '/sys/resource',
                meta: {
                    title: '资源管理',
                    icon: 'md-apps',
                    storeModules: ['ResourceStore','ClientStore']
                },
                component: () => resolveComponent('view/sys/resource')
            }]
        },
        {
            path: '*',
            name: 'error_404',
            meta: {
                hideInMenu: true
            },
            component: () => resolveComponent('view/error/404')
        }
    ]
    return routerTable
})
